<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<script type="text/javascript">
	function showMsg($item, msgType, msg, timeout){
		var classType='ui-state-highlight';
		if(msgType=='error'){
			classType='ui-state-error';
		}
		$item.addClass(classType);
		$item.html("<span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span>"+msg);
		setTimeout(function(){$item.html('').removeClass(classType);},timeout);
	}
	function query(){
		var key=jQuery.trim($('#key').val());
		if(key.length==0){
			showMsg($('#searchMsg'),'error','请输入关键字',5000);
			return;
		}
		window.location.href="<c:url value='/search?'/>key="+encodeURIComponent(key);
	}
	function enterKey(){
		if(event.keyCode==13){query();}
	}
	$(function(){
		$('#key').focus();
		$('#search').click(function(){query();});
	});
</script>